package com.aaa.three.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @PACKAGE_NAME: com.ck.day41.result
 * @NAME: AjaxResult
 * @USER: Tprairie
 * @DATE: 2022/1/1
 * @PROJECT_NAME: day41
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {
    private Integer code;
    private String msg;
    private Object data;
    public static AjaxResult success(){
        return new AjaxResult(1,"操作成功",null);
    }
    public static AjaxResult success(Object data ){
        return new AjaxResult(1,"操作成功",data);
    }
    public static AjaxResult fail(String msg){
        return new AjaxResult(0,msg,null);
    }
    public static AjaxResult fail(Object data){
        return new AjaxResult(0,"操作失败",null);
    }

}
